Aras Innovator – Server Method for Client

,

/*
Use parameters that send from other method and Aras PLM permission to query the sql server.
*/

var inn = this.getInnovator();
var classification = this.getPropertyAttribute("Item","classification");
var item_number = this.getPropertyAttribute("Item","item_number");

Aras.Server.Security.Identity plmIdentity = Aras.Server.Security.Identity.GetByName("Aras PLM");
bool permissionWasSet = Aras.Server.Security.Permissions.GrantIdentity(plmIdentity);
try {
var callframe = inn.newItem("SQL", "SQL PROCESS");
callframe.setProperty("name", "GetLatestVersion");
callframe.setProperty("PROCESS", "CALL");
callframe.setProperty("ARG1", classification);
callframe.setProperty("ARG2", item_number);
callframe.setProperty("ARG3", year);
var specialNumber = callframe.apply();
return specialNumber;
}
finally {
if (permissionWasSet) {
Aras.Server.Security.Permissions.RevokeIdentity(plmIdentity);
}
}

留言

Leave a comment

This site uses Akismet to reduce spam. Learn how your comment data is processed.