8. Januar 2010 13:04
Text := 'Dies ist ein weiterer wertvoller Hinweis';
LenChar := STRLEN(Text);
Text := FORMAT(LenChar) + Text;
Cont.GET('1000');
NewID := Cont.ADDLINK('dynamicsnav://dell-rotsch:7046/myCharity/myCharity/runpage?page=5050&mode=Edit',
'Über eigene Funktion erstellt');
RecordLink.GET(NewID);
RecordLink.CALCFIELDS(Note);
RecordLink.Note.CREATEOUTSTREAM(OutStream);
OutStream.WRITE(Text);
RecordLink.Type := RecordLink.Type::Note;
RecordLink.Notify := TRUE;
RecordLink."To User ID" := USERID;
RecordLink.MODIFY;
16. März 2012 17:09
16. März 2012 18:23
OnRun()
Cust.GET('100001');
RecRef2.GETTABLE(Cust);
Send(RecRef2, 'Hallo Welt!', 21, 'USER XY');
Send(RecRef : RecordRef;Message : Text[1024];PageID : Integer;ToUser : Text[132])
LenChar := STRLEN(Message);
Message := FORMAT(LenChar) + Message;
RecordLink.GET(RecRef.ADDLINK('dynamicsnav://localhost:7046/SERVICEINSTANCE/'+COMPANYNAME+'/'+
'runpage?page='+FORMAT(PageID)+
'&bookmark='+FORMAT(RecRef.RECORDID,0,10)+
'&mode=Edit'));
RecordLink.CALCFIELDS(Note);
RecordLink.Note.CREATEOUTSTREAM(OutStream);
OutStream.WRITE(Message);
RecordLink.Description := FORMAT(RecRef.RECORDID);
RecordLink.Type := RecordLink.Type::Notiz;
RecordLink.Notify := TRUE;
RecordLink."To User ID" := ToUser;
RecordLink.MODIFY;
17. März 2012 14:46
20. März 2012 11:22
20. März 2012 15:36
BuildDescription(RecRef : RecordRef) Description : Text[1024]
Description := RecRef.CAPTION + ' -';
KeyRef := RecRef.KEYINDEX(1); //1 for Primary Key
FOR i := 1 TO KeyRef.FIELDCOUNT DO BEGIN
FldRef := KeyRef.FIELDINDEX(i);
IF i = 1 THEN
Description += ' ' + FORMAT(FldRef.VALUE)
ELSE
Description += ', ' + FORMAT(FldRef.VALUE);
END;
NoteOutStream.WRITE(
dstEncoding.GetString(
Encoding.Convert(
srcEncoding,
dstEncoding,
srcEncoding.GetBytes(Message))));
16. Januar 2013 09:43
16. Januar 2013 13:58
16. Januar 2013 15:01
16. Januar 2013 16:50
LenChar := STRLEN(MessageText);
MessageText := FORMAT(LenChar) + MessageText;
RecordLink.GET(RecRef.ADDLINK('dynamicsnav://localhost:7046/SERVICEINSTANCE/'+COMPANYNAME+'/'+
'runpage?page='+FORMAT(PageID)+
'&bookmark='+FORMAT(RecRef.RECORDID,0,10)+
'&mode=Edit'));
RecordLink.CALCFIELDS(Note);
RecordLink.Note.CREATEOUTSTREAM(OutStream);
streamWriter := streamWriter.StreamWriter(OutStream, encoding.Unicode);
// streamWriter := streamWriter.StreamWriter(OutStream);
streamWriter.WriteLine(MessageText);
streamWriter.Close();
RecordLink.Description := initDescription(RecRef);
RecordLink.Type := RecordLink.Type::Note;
RecordLink.Notify := TRUE;
RecordLink."To User ID" := ToUser;
RecordLink.MODIFY;
streamWriter := streamWriter.StreamWriter(OutStream, encoding.Unicode);
16. Januar 2013 19:02
28. Januar 2013 11:06
28. Januar 2013 11:17
21. Juni 2013 17:05
OBJECT Codeunit 50007 Record Notification
{
OBJECT-PROPERTIES
{
Date=21.06.13;
Time=17:04:07;
Modified=Yes;
Version List=CDG V1.00;
}
PROPERTIES
{
OnRun=BEGIN
END;
}
CODE
{
PROCEDURE CreateNotification@1000000000(RecRef@1000000000 : RecordRef;PageID@1000000001 : Integer;MessageText@1000000002 : Text[1024];ToUserID@1000000007 : Code[20]);
VAR
RecLink@1000000016 : Record 2000000068;
Session@1000000015 : Record 2000000009;
DomDoc@1000000014 : Automation "{F5078F18-C551-11D3-89B9-0000F81FE221} 6.0:{88D96A05-F192-11D4-A65F-0040963251E5}:'Microsoft XML, v6.0'.DOMDocument60";
DomNode@1000000013 : Automation "{F5078F18-C551-11D3-89B9-0000F81FE221} 6.0:{2933BF80-7B36-11D2-B20E-00C04F983E60}:'Microsoft XML, v6.0'.IXMLDOMNode";
encoding@1000000012 : DotNet "'mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089'.System.Text.Encoding";
streamWriter@1000000009 : DotNet "'mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089'.System.IO.StreamWriter";
stream@1000000008 : DotNet "'mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089'.System.IO.Stream";
NoteOutStream@1000000017 : OutStream;
ChrLen@1000000006 : Char;
ServerName@1000000005 : Text[50];
ServerPort@1000000004 : Text[50];
ServerInstance@1000000003 : Text[50];
BEGIN
ChrLen := STRLEN(Umlaut2PlainText(MessageText));
MessageText := FORMAT(ChrLen) + MessageText;
Session.RESET;
Session.SETRANGE("My Session", TRUE);
Session.FINDFIRST;
ServerName := Session."Host Name";
IF ISCLEAR(DomDoc) THEN
CREATE(DomDoc);
DomDoc.load(APPLICATIONPATH + 'CustomSettings.config');
DomNode := DomDoc.selectSingleNode('//appSettings/add[@key=''ServerPort'']');
ServerPort := DomNode.attributes.item(1).text;
DomNode := DomDoc.selectSingleNode('//appSettings/add[@key=''ServerInstance'']');
ServerInstance := DomNode.attributes.item(1).text;
RecLink.GET(RecRef.ADDLINK('dynamicsnav://' + ServerName +
':' + ServerPort +
'/' + ServerInstance +
'/' + COMPANYNAME +
'/runpage?page=' + FORMAT(PageID) +
'&bookmark=' + FORMAT(RecRef.RECORDID,0,10) +
'&mode=Edit'));
RecLink.Description := BuildDescription(RecRef);
RecLink.Type := RecLink.Type::Notiz;
RecLink.CALCFIELDS(Note);
RecLink.Note.CREATEOUTSTREAM(NoteOutStream);
streamWriter := streamWriter.StreamWriter(NoteOutStream);
streamWriter.WriteLine(MessageText);
streamWriter.Close();
RecLink.Notify := TRUE;
RecLink."To User ID" := ToUserID;
RecLink.MODIFY;
END;
PROCEDURE BuildDescription@1000000020(RecRef@1000000000 : RecordRef) Description : Text[1024];
VAR
i@1000000003 : Integer;
FldRef@1000000002 : FieldRef;
KeyRef@1000000001 : KeyRef;
BEGIN
Description := RecRef.CAPTION + ' -';
KeyRef := RecRef.KEYINDEX(1); //1 for Primary Key
FOR i := 1 TO KeyRef.FIELDCOUNT DO BEGIN
FldRef := KeyRef.FIELDINDEX(i);
IF i = 1 THEN
Description += ' ' + FORMAT(FldRef.VALUE)
ELSE
Description += ', ' + FORMAT(FldRef.VALUE);
END;
END;
PROCEDURE Umlaut2PlainText@1107700003(Text@1107700000 : Text[1024]) NewText : Text[1024];
VAR
J@1107700004 : Integer;
I@1107700005 : Integer;
BEGIN
J := 0;
FOR I := 1 TO STRLEN(Text) DO
CASE Text[I] OF
'Ž','','’': AddChar(NewText,'AE',J);
'„','†','‘': AddChar(NewText,'ae',J);
'µ','·','¶','Ç': AddChar(NewText,'A',J);
' ','…','ƒ','Æ': AddChar(NewText,'a',J);
'€': AddChar(NewText,'C',J);
'‡': AddChar(NewText,'c',J);
'Ñ': AddChar(NewText,'D',J);
'Ð': AddChar(NewText,'d',J);
'','Ô','Ò','Ó': AddChar(NewText,'E',J);
'‚','Š','ˆ','‰': AddChar(NewText,'e',J);
'Ö','Þ','×','Ø': AddChar(NewText,'I',J);
'¡','','Œ','‹': AddChar(NewText,'i',J);
'¥': AddChar(NewText,'N',J);
'¤': AddChar(NewText,'n',J);
'™','': AddChar(NewText,'OE',J);
'”','›': AddChar(NewText,'oe',J);
'à','ã','â','å': AddChar(NewText,'O',J);
'¢','•','“','ä': AddChar(NewText,'o',J);
'š': AddChar(NewText,'UE',J);
'': AddChar(NewText,'ue',J);
'é','ë','ê': AddChar(NewText,'U',J);
'£','—','–': AddChar(NewText,'u',J);
'í': AddChar(NewText,'Y',J);
'ì','˜': AddChar(NewText,'y',J);
'á': AddChar(NewText,'ss',J);
'¸': AddChar(NewText,'(c)',J);
'©': AddChar(NewText,'(r)',J);
'®': AddChar(NewText,'<<',J);
'¯': AddChar(NewText,'>>',J);
'¬': AddChar(NewText,'1/4',J);
'«': AddChar(NewText,'1/2',J);
'ó': AddChar(NewText,'3/4',J);
ELSE
AddChar(NewText,FORMAT(Text[I]),J);
END;
END;
LOCAL PROCEDURE AddChar@1107700004(VAR Text@1107700000 : Text[1024];NewText@1107700001 : Text[30];VAR NewTextPos@1107700002 : Integer);
VAR
Counter@1107700003 : Integer;
BEGIN
FOR Counter := 1 TO STRLEN(NewText) DO BEGIN
IF NewTextPos < MAXSTRLEN(Text) THEN BEGIN
NewTextPos += 1;
Text[NewTextPos] := NewText[Counter];
END;
END;
END;
BEGIN
END.
}
}
21. Juni 2013 20:11
OBJECT Codeunit 52000 Notes Handling
{
OBJECT-PROPERTIES
{
Date=21.06.13;
Time=12:00:00;
Version List=;
}
PROPERTIES
{
OnRun=VAR
RecRef@1000000000 : RecordRef;
Customer@1000000001 : Record 18;
NoteId@1000000002 : Integer;
BEGIN
Customer.FINDFIRST;
RecRef.GETTABLE(Customer);
NoteId := WriteNote(RecRef, PAGE::"Customer Card",
STRSUBSTNO('Hällööö, dies ist meine Nötiz (%1)',CURRENTDATETIME), USERID);
MESSAGE(ReadNote(NoteId));
END;
}
CODE
{
PROCEDURE ReadNote@1000000000(NoteId@1000000000 : Integer) : Text;
VAR
RecordLink@1000000001 : Record 2000000068;
NoteInStream@1000000002 : InStream;
StreamReader@1000000003 : DotNet "'mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089'.System.IO.StreamReader";
BinaryReader@1000000004 : DotNet "'mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089'.System.IO.BinaryReader";
NoteText@1000000005 : Text;
BEGIN
RecordLink.GET(NoteId);
RecordLink.CALCFIELDS(Note);
RecordLink.Note.CREATEINSTREAM(NoteInStream);
StreamReader := StreamReader.StreamReader(NoteInStream);
BinaryReader := BinaryReader.BinaryReader(StreamReader.BaseStream);
NoteText := BinaryReader.ReadString();
BinaryReader.Close();
StreamReader.Close();
EXIT(NoteText);
END;
PROCEDURE WriteNote@1000000001(RecRef@1000000000 : RecordRef;PageID@1000000008 : Integer;NoteText@1000000006 : Text;NotificationUserID@1000000005 : Code[50]) : Integer;
VAR
RecordLink@1000000001 : Record 2000000068;
ServerInstance@1000000007 : Record 2000000112;
NoteOutStream@1000000002 : OutStream;
StreamWriter@1000000003 : DotNet "'mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089'.System.IO.StreamWriter";
BinaryWriter@1000000004 : DotNet "'mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089'.System.IO.BinaryWriter";
BEGIN
ServerInstance.SETRANGE("Server Instance ID",SERVICEINSTANCEID);
ServerInstance.FINDFIRST;
RecordLink.GET(
RecRef.ADDLINK(
STRSUBSTNO('DynamicsNAV://%1:%2/%3/%4/runpage?page=%5&bookmark=%6&mode=Edit',
ServerInstance."Server Computer Name",
FORMAT(ServerInstance."Server Port"),
ServerInstance."Service Name",
COMPANYNAME,
FORMAT(PageID),
FORMAT(RecRef.RECORDID,0,10))));
RecordLink.Description := GetDescription(RecRef);
RecordLink.Type := RecordLink.Type::Note;
RecordLink.Created := CURRENTDATETIME;
RecordLink."User ID" := USERID;
RecordLink.Company := COMPANYNAME;
IF NotificationUserID <> '' THEN BEGIN
RecordLink.Notify := TRUE;
RecordLink."To User ID" := NotificationUserID;
END;
RecordLink.Note.CREATEOUTSTREAM(NoteOutStream);
StreamWriter := StreamWriter.StreamWriter(NoteOutStream);
BinaryWriter := BinaryWriter.BinaryWriter(StreamWriter.BaseStream);
BinaryWriter.Write(NoteText);
BinaryWriter.Close();
StreamWriter.Close();
RecordLink.MODIFY;
EXIT(RecordLink."Link ID");
END;
PROCEDURE GetDescription@1000000002(RecRef@1000000000 : RecordRef) : Text;
VAR
Description@1000000001 : Text;
BEGIN
Description := FORMAT(RecRef.RECORDID);
EXIT(RecRef.CAPTION + COPYSTR(Description,STRPOS(Description,':')));
END;
BEGIN
END.
}
}
23. Juni 2013 21:30
IF ISNULL(Config) THEN
Config := Config.Instance;
ServerComputerName := Config.GetStringSetting('Server');
ServerInstance := Config.GetStringSetting('ServerInstance');
ServerPort := Config.GetStringSetting('ClientServicesPort');
UrlString := STRSUBSTNO('DynamicsNAV://%1:%2/%3/%4',ServerComputerName,ServerPort,ServerInstance,COMPANYNAME);
EXIT(UrlString);
23. Juni 2013 21:39
Fido hat geschrieben:das man ab 2013 für das Ermitteln der Server Instance die CU 9500 anzapfen kann.
23. Juni 2013 23:18