question

Jan-5833 avatar image
0 Votes"
Jan-5833 asked

Script error Value should be of type: Date: Parameter Name: value

Hi All,

After migrating to Dynamics Sales 9.1 on-premises I get this script error.

Value should be of type: Date: Parameter Name: value

new_prikdatum is an option list with the options 1 week and 2 weeks. I want to calculate the datefield prikdatum after an option is selected. help is much appreciated. Thank you.


//Prikdatum berekenen
function prikdatumover(ExecutionContext){
var prikdatum = ExecutionContext.getFormContext().data.entity.attributes.get("new_prikdatum");
var now = new Date();

   if(ExecutionContext.getFormContext().getAttribute("new_over").getText() == "1 week")

{
var endDate = new Date().setDate(now.getDate()+7);
prikdatum.setValue(endDate);
}

 if(ExecutionContext.getFormContext().getAttribute("new_over").getText() == "2 weken")

{
var endDate = new Date().setDate(now.getDate()+14);
prikdatum.setValue(endDate);
}
}

microsoft-365-apps-publishing-dev
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

0 Answers