Thursday 18 July 2013

Restricting Synonym domain lookup values in List tab

This can be done by using Security Group data restrictions.

1) Create a condition as below:
Condition Name : TESTSTATUS
Condition expression is VALUE IN ('APPR','WAPPR','DRAFT') <Make sure there is no colon (:) in the expression and also no validation required>

2) Apply condition in Security group :
Select require security group and go to data restrictions tab.
Enter new row :
Object : SYNONYMDOMAIN
Application : <Application name>
Type : Qualified
Condition : TESTSTATUS
Reevaluate : Checked

Save the security group and signout & signin again.
Now you can able to see the only require statuses in List and Advanced Search Tab.

Note : 
1. In condition, make sure there will be no COLON ':' in condition expression. No validation require at condition.
2. By applying condition to SYNONYMDOMAIN at security group data restrictions, it will be applicable all synonymdomains for that application. Usually for any application, synonym domains values (not maxvalue) will be unique.


Increase a field value like workorder/jobplan taskid.

1. Create a seed name and seed interval in MAXVARS table.

For example : if you want as 10, 20, 30 40..etc
insert into MAXVARS (varname,varvalue,orgid,siteid,maxvarsid) values ('TESTSEED',10,NULL,'SITENAME',<MAXVARSID.NEXTVAL>);
insert into MAXVARS (varname,varvalue,orgid,siteid,maxvarsid) values ('TESTSEEDINTERVAL',10,NULL,'SITENAME',<MAXVARSID.NEXTVAL>);

For example : if you want as 5, 10, 15, 20..etc
insert into MAXVARS (varname,varvalue,orgid,siteid,maxvarsid) values ('TESTSEED',5,NULL,'SITENAME',<MAXVARSID.NEXTVAL>);
insert into MAXVARS (varname,varvalue,orgid,siteid,maxvarsid) values ('TESTSEEDINTERVAL',5,NULL,'SITENAME',<MAXVARSID.NEXTVAL>);

2. Write a mbo code to set value in 'TESTID' : <set default value of TESTID is 0>
Modify add() method of main MBO :

super.add();
int testID = this.getInt("TESTID");
int newTestID = CommonUtil.getNextTaskID(testID, "TESTSEED", "TESTSEEDINTERVAL", getOrgSiteForMaxvar("TESTSEED"));
this.setValue("TESTID",newTestID,MboConstants.NOACCESSCHECK);

Hope it will be usefull. :)


Increase MAXSEQUENCE in SQL Server

Some times developers will insert records using sql script.

Oracle database : you can get sequenceid by using NEXTVAL.

SQL Server : There is no function called NEXTVAL. Below are the steps you can follow :


SET NOCOUNT ON;

--Declare integer variable
declare @seqid int

--Update MAXSEQUENCE table by increasing MAXRESERVED value+1.
update [maxsequence] set [maxreserved] = [maxreserved]+1 where [tbname] = 'MAXATTRIBUTE' and [name] = 'MAXATTRIBUTEID'
GO

--Get MAXRESERVED from MAXSEQUENCE table and Set to integer variable (in this case @seqid)
SET @seqid = (select maxreserved from maxsequence  where [tbname] = 'MAXATTRIBUTE' and [name] = 'MAXATTRIBUTEID')

--When inserting use @seqid at your sequenceid value. Below case, MAXATTRIBUTEID value replaced with @seqid.
INSERT INTO MAXATTRIBUTE
 (MAXATTRIBUTEID,OBJECTNAME,ATTRIBUTENAME,.................) VALUES
( @seqid,<OBJECTNAME>,<ATTRIBUTENAME>,.........)
GO

For multiple inserts, add 'update step' and 'set sequenceid in variable step' before every insert :


--Update MAXSEQUENCE table by increasing MAXRESERVED value+1.
update [maxsequence] set [maxreserved] = [maxreserved]+1 where [tbname] = '<OBJECTNAME>' and [name] = '<OBJECTSEQUENCEIDNAME>'
GO

--Get MAXRESERVED from MAXSEQUENCE table and Set to integer variable (in this case @seqid)
SET @seqid = (select maxreserved from maxsequence  where [tbname] = '<OBJECTNAME>' and [name] = '<OBJECTSEQUENCEID NAME>')


INSERT INTO <OBJECTNAME>
 (OBJECTSEQID,,.................) VALUES
( @seqid,,.........)
GO

Hope it will be useful. :)


Add default value to long description field.

It is same as assigning default values to other fields.

Go to Application Designer --> Select your application --> go to require section --> drag and drop default value control from control palette --> select control properties for default value :

Attribute : Click on lookup and select attribute as DESCRIPTION_LONGDESCRIPTION for your object.
Value : <Add your default text>
Default Type : Insert <this will work while inserting new record in your application>

Save the application designer and try to insert new record in your application. Long description field will display your default text value entered in VALUE field.

Hope it will be useful :)

Maximo SOAPUI error javax.xml.ws.WebServiceException

SOAPUI error while sending payload to below url (in cluster environment) http://localhost:9080/meaweb/services/MXASSET Error : <f...