Hi,
I need to add a feature to rename prod id in Production order form, could anyone give suggestion to do that?
Thanks.
Hi,
I need to add a feature to rename prod id in Production order form, could anyone give suggestion to do that?
Thanks.
Is it not working in standard?
Yes its working in standard, but we need to do it directly without going into record info.
What do you mean by doing it directly?
I need to select Prodid from a dialog box and pass it to renamekey function to rename the Prodid
See the below example code,
void clicked()
{
Dialog dialog;
DialogField dlgProdId;
dialog = new dialog(‘Update Prod id’);
dlgProdId = dialog.addField(identifierStr(ProdId), ‘Prod Id’);
dialog.run();
dialog.wait();
if (dlgProdId .value() && dialog.closedOk())
{
ProdTable.ProdId = dlgProdId.value();
ProdTable.renamePrimaryKey();
ProdTable_ds.reread();
ProdTable_ds.refresh();
}
}
Shall I create a button directly in production order form and add this method in clicked?
Yes.
I gave typeid is that okay?
I think identifierStr doesn’t exist in AX 2009. Using TypeId should be fine.
Wen i gave prodid in tat dialog box it isn’t showing anything after that…
What does that mean?
Wen i click rename button in form and gave prodid its showing the below error
Does a production order with that id already exists? Use a number that doesn’t exists in the list of production orders.
Also try using this code, so that you won’t end up with selecting an existing production order.
dlgProdId = dialog.addField(TypeId(str), ‘Prod Id’);
Also if i doesn’t enter any value there in production id field its not allowing me to close the prodtable form
Done like this Kranthi
dlgProdId = dialog.addFieldValue(Types::String,id,“Production Id”);
But its not allowing me to close wen i didn’t gave any id there, wat should i do now?
Can you show your code?